#include<bits/stdc++.h>
using namespace std;
#define xyf main
#define maxn 51
#define maxh 500001

inline int read()
{
	int f=1,x=0;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int n,h[maxn],s[maxn];
int dp[maxn][maxh];
inline void init()
{
	n=read();
	for(int i=1;i<=n;++i)
	{
		h[i]=read();
		s[i]=s[i-1]+h[i];
	}
}
inline void update(int& i,int& j)
{
	dp[i][j]=dp[i-1][j];
	if(j>=h[i])
		dp[i][j]=max(dp[i][j],dp[i-1][j-h[i]]);
	if(j+h[i]<=s[i-1])
		dp[i][j]=max(dp[i][j],dp[i-1][j+h[i]]+h[i]);
	if(j<=h[i])
		dp[i][j]=max(dp[i][j],dp[i-1][h[i]-j]+h[i]-j);			
}
inline void DP()
{
	memset(dp,-0x3f,sizeof(dp));
	dp[0][0]=0;
	for(int i=1;i<=n;++i)
		for(int j=0;j<=s[i];++j)
			update(i,j);
	if(!dp[n][0])
		cout<<"Impossible\n";
	else
		cout<<dp[n][0]<<endl;
}
int xyf()
{
	freopen("tower.in","r",stdin);
	freopen("tower.out","w",stdout);
	init();
	DP();
	return 0;
}
